﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ones.ServiceNewsManagement;

namespace Ones.Editorial.Approver
{
    public partial class NewsDisplay : System.Web.UI.Page
    {
        private ServiceNewsManagement.ServiceNewsManagementClient srvNewsMngmt = null;

        #region Events
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                srvNewsMngmt = new ServiceNewsManagementClient();

                rptNewsList.DataSource = srvNewsMngmt.getAllFilterNews(false);
                rptNewsList.DataBind();
            }
        }

        protected void LinkButton_ItemCommand(object sender, RepeaterCommandEventArgs e)
        {
            Session["newsId"] = e.CommandArgument.ToString();

            switch (e.CommandName.ToString())
            {
                case "AEditNews":
                    Response.Redirect("~/Editorial/Approver/NewsApproval.aspx");
                    break;
                case "ADeleteNews":

                    break;
            }
        }

        #endregion

        #region Methods

        #endregion
    }
}